<template>
    <button @click="isSHow = true">打开</button>
    <teleport to="body">
        <div class="modal" v-show="isSHow">
            <h2>弹窗</h2>
            {{ yy }}

            <button @click="isSHow = false"> 关闭</button>
        </div>
    </teleport>
</template>

<script lang='ts' setup>
import { ref } from 'vue'
let isSHow = ref(false)
</script>
<style scoped>
.modal {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: rgb(210, 161, 161);
}
</style>